# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        博智科技  
# Name:         main
# Description:
# Author:       yzl
# Date:         2019-06-16
#-------------------------------------------------------------------------------

from flask import Flask,render_template,flash,request,redirect,url_for,jsonify
import json
app = Flask(__name__)
app.secret_key = "sdsfdsgdfgdfgfh"

@app.route('/hello')
def hello():
    return 'hello'

@app.route('/index')
def index():
    return render_template('index.html')

@app.route('/index1')
def index1():
    return render_template('index1.html')

@app.route('/dologin',methods=['GET','POST'])
def dologon():
    if request.method == 'GET':
        username = request.args.get('username')
        passowrd = request.args.get('password')
        # data = request.args.to_dict()

        data = {
            'username': username,
            'password': passowrd,
            'data':request.args.to_dict()
        }
    else:
        username = request.form.get('username')
        passowrd = request.form.get('password')

        data = {
            'username':username,
            'password':passowrd,
            'values':request.values
        }
    return jsonify(data)

@app.route('/dlg1')
def dlg1():

    return render_template('dlg1.html')


if __name__ == '__main__':
    app.run(debug=True)

